luci-app-attendedsysupgrade: fix empty array condition
authorPaul Spooren <[email protected]>
Sun, 25 Jul 2021 22:36:19 +0000 (00:36 +0200)
committerPaul Spooren <[email protected]>
Mon, 26 Jul 2021 12:02:22 +0000 (14:02 +0200)
commit132c72c7b75b7c69ec713cd9c44b7566da7f052a
treec74f29be4f9437ffb5c581a13eefa62dcdad0e07
parentf543a84c5bc534d3d85c75c522367ff24349d266
luci-app-attendedsysupgrade: fix empty array condition

In JavaScript (other than in Python) an empty array is considered `true`
within if statements. Fix this by checking for the array length rather
than its existence.

This fixes the issue of an empty dropdown menu in case the user is
running the latest release.

Signed-off-by: Paul Spooren <[email protected]>
(cherry picked from commit 7f5becc69e004f831c9dc09e0859c179b439c7d2)
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js